package zhongbo.java.air.monitor.listener;

import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
import org.springframework.stereotype.Component;
import zhongbo.java.air.monitor.we.WebsocketAir;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import static zhongbo.java.air.monitor.config.RedisListenerConfig.INJEST_PATH;

@Component
public class RedisLogChanelPublisher {
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    // 发送消息到频道
    public void broadcast(String message) {
        redisTemplate.convertAndSend(INJEST_PATH, message);
    }

}
